<!DOCTYPE html>
<html>
  <head>
<script src="../0218-jquery/jquery-3.3.1.js"></script>
<script>
    
     $(function(){
       var num =1;
      function changeImg(){
             var element = $("#img1");
             element.prop("src",num+".jpg");
              num += 1;
              console.log(element)
              if (num >3) {
                  num=1;
              } else {
                  
              }
         }  
         setInterval(changeImg,1000);


     }) 
</script>

  </head>
  <body>
    <img src="1.jpg" alt="" id="img1">

  </body>
</html>